Skip to content

SOLR-18297 Upgrade Jetty to 12.1.10#4574

Open
janhoy wants to merge 18 commits into
apache:mainfrom
janhoy:SOLR-18297-update-jetty-12.1.10
Open

SOLR-18297 Upgrade Jetty to 12.1.10#4574
janhoy wants to merge 18 commits into
apache:mainfrom
janhoy:SOLR-18297-update-jetty-12.1.10

Conversation

@janhoy

@janhoy janhoy commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18297

Description

Upgrades Eclipse Jetty from 12.0.34 to 12.1.10. This is a minor-line jump (12.0 → 12.1) that the 12.0 line is being wound down for, and it required real migration work beyond the version bump — both source API changes and a server-configuration migration.

What changed

1. Dependency

  • eclipse-jetty 12.0.3412.1.10 in gradle/libs.versions.toml.
  • Regenerated lockfiles and license *.sha1 files. Jetty 12.1 adds new transitive modules (jetty-compression-common, jetty-compression-gzip) and renames jetty-eejetty-ee-webapp; the new compression jars are covered by the existing jetty- license prefix.

2. Source API adaptations (compile, -Werror)

Three APIs were deprecated-for-removal / removed in 12.1:

  • BlockingArrayQueue(int, int) (growBy removed) → BlockingArrayQueue.newInstance(256, Integer.MAX_VALUE), preserving the original unbounded-with-initial-capacity semantics (HttpJettySolrClient).
  • org.eclipse.jetty.io.RuntimeIOExceptionjava.io.UncheckedIOException (SolrCore, CatStream).
  • HttpClient.getTransport()getHttpClientTransport() (HttpJettySolrClientCompatibilityTest).

3. Server configuration migration (solr/server/etc/jetty.xml)

Jetty 12.1 removed the directory-scanning deployer (DeploymentManager / deploy.providers.ContextProvider). Since Solr serves a single, statically-known webapp, the deployer machinery is unnecessary — the webapp is now added directly to the ContextHandlerCollection, and the redundant solr/server/contexts/solr-jetty-context.xml is removed. Without this change the distribution fails to start on 12.1 (ClassNotFoundException: org.eclipse.jetty.deploy.DeploymentManager). Considered re-implementing scanning with the new APIs, but keeping it simpler. Advanced users who deploy 3rd party webapps in Solr's Jetty still have the option of tailoring jetty.xml to add those or to wire in scanning. An upgrade note has been added to the ref-guide.

4. Config cleanups

  • Set maxResponseHeaderSize explicitly, configurable via the new solr.jetty.response.header.size.max system property. Jetty 12.1 changed this default from 8KB to 16KB; the property makes the value explicit and tunable. This is the one behavioral change administrators may notice — response headers up to 16KB are now allowed by default.
  • Removed the redundant relativeRedirectAllowed=true set — it is the Jetty 12.1 default.

Migration-guide review

Reviewed every file under solr/server/etc/ against the Jetty 12.0→12.1 migration guide. The deployer block was the only outdated configuration; all other XML (SSL/HTTPS/HTTP2, gzip, request-log, threadpool) resolves cleanly on 12.1. GzipHandler/DeflaterPool are still present, so the gzip module is unaffected.

Verification

  • ./gradlew check -x test — passes (compile, forbidden-apis, license validation).
  • Unit tests pass: solrj-jetty (incl. HTTP/1↔HTTP/2 compatibility), extraction, and a core HTTP/servlet sample.
  • BATS packaging tests pass 18/18: test_compression, test_ssl (incl. mTLS, client truststore + SecurityManager), test_start_solr.
  • Manual smoke test against a gradlew dev distribution: server starts, /solr returns HTTP 200, WebAppContext reports AVAILABLE, and gzip content-encoding negotiates correctly.

Out of scope (potential follow-ups)

  • Migrating the gzip module to Jetty 12.1's pluggable Compression API (would also enable Brotli/Zstandard). gzip.mod/GzipHandler still work, so this is optional.
  • EE10 → EE11 (Jakarta Servlet 6.1) — EE10 remains supported in 12.1.

solrbot and others added 7 commits July 1, 2026 01:38
- BlockingArrayQueue(int,int) ctor removed: use newInstance(256, Integer.MAX_VALUE)
- org.eclipse.jetty.io.RuntimeIOException -> java.io.UncheckedIOException
- HttpClient.getTransport() -> getHttpClientTransport()
- Regenerate lockfiles + license sha1s (new jetty-compression-* modules, jetty-ee->jetty-ee-webapp rename)
Jetty 12.1 removed the DeploymentManager/ContextProvider directory-scanning
deployer. Since Solr serves a single, statically-known webapp, deploy it directly
into the ContextHandlerCollection in jetty.xml and drop the now-redundant
contexts/solr-jetty-context.xml. Verified: server starts, /solr returns 200, gzip works.

Also: set maxResponseHeaderSize explicitly (configurable; Jetty 12.1 changed its
default 8192->16384) and remove the redundant relativeRedirectAllowed=true (now the
Jetty 12.1 default).
@janhoy janhoy mentioned this pull request Jun 30, 2026
1 task
…nce apache#4572 merges)

Squashed changes from apache#4572 'Fix UI build due to Ktor upgrade' (dsmiley)
to unblock CI/testing of this branch. Without it the solr:ui wasmJs browser webpack
build fails on node:net, forcing -PdisableUiModule=true locally.

THIS COMMIT IS TEMPORARY and must be dropped/reverted once apache#4572 is merged to main
and this branch is rebased onto it.
@janhoy janhoy requested a review from dsmiley July 1, 2026 00:28
@janhoy

janhoy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

The test failures are real for S3 tests, TestDistributedTracing.testV2Api and JWTAuthPluginIntegrationTest.testInternodeAuthorization. S3 can be handled by first merging #3122

…ernode proxy

Jetty 12.1 aborts responses whose written bytes don't match a declared
Content-Length ('too much content written' / 400). Solr's streaming
writers can't predict the length, so:
- JettyBridgeResponseWriter: don't set Content-Length; send chunked.
- HttpSolrProxy: don't forward Host or Content-Length; the Jetty client
  re-derives them for the upstream.
@janhoy

janhoy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed two Jetty 12.1 test failures caused by its stricter Content-Length enforcement (writing bytes != declared length now aborts with "too much content written"/400):

  • JettyBridgeResponseWriter (v2/Jersey): no longer sets a Content-Length Solr can't guarantee for streamed responses — sends chunked instead (matches the v1 path). Fixes TestDistributedTracing.testV2Api.
  • HttpSolrProxy: no longer forwards Host/Content-Length on proxied internode requests; the Jetty client re-derives them for the upstream. Fixes JWTAuthPluginIntegrationTest.testInternodeAuthorization.

Both reproduced with the CI seed and now pass; full test classes green; check -x test clean. (S3 module failures are separate — resolved by #3122.)

@dsmiley dsmiley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You said somethjing about a distributed trace fix but... I don't see changes htere.

Comment thread changelog/unreleased/SOLR-18297-update-jetty-12.1.10.yml Outdated
Comment thread solr/core/src/java/org/apache/solr/servlet/HttpSolrProxy.java Outdated
Comment thread solr/core/src/java/org/apache/solr/servlet/HttpSolrProxy.java Outdated
Comment thread solr/server/etc/jetty.xml
Comment thread solr/server/etc/jetty.xml
Comment thread solr/ui/build.gradle.kts
@janhoy

janhoy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

You said somethjing about a distributed trace fix but... I don't see changes htere.

TestDistributedTracing.testV2Api failed due to Content-Length mismatch, the fix for that failure is not in dist.tracing but in JettyBridgeResponseWriter.java

Comment thread solr/core/src/java/org/apache/solr/servlet/HttpSolrProxy.java Outdated
@janhoy janhoy requested a review from dsmiley July 2, 2026 11:06
@janhoy

janhoy commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@dsmiley Both code paths now conditionally forward Content-Lenght when >0 and known. Added some new tests as well.

Comment thread solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java
Comment thread solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java
@janhoy janhoy mentioned this pull request Jul 2, 2026
1 task
…inistic proxy CL test

- JettyBridgeResponseWriter: use setContentLengthLong (drops the int cast and
  MAX_VALUE guard); simplify the >0 guard comment.
- HttpSolrProxyTest: make the response Content-Length assertion unconditional
  (rows=0 stays within Jetty's buffer so the origin always frames it with a
  length); note why a filestore fetch isn't applicable (it doesn't proxy).

@dsmiley dsmiley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks.

@janhoy

janhoy commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for good teamwork David. I'll burn some Copilot tokens and then merge to main as a first step, let it marinate on main for some time and backport to 10x in time for a 10.1 release.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades Solr’s embedded Jetty stack to Eclipse Jetty 12.1.10, including necessary API migrations and a Jetty server configuration update to account for Jetty 12.1 removing the directory-scanning deployer, plus related test and documentation updates.

Changes:

  • Bump Jetty from 12.0.34 → 12.1.10 (version catalog, lockfiles, and license SHA1s).
  • Migrate server/etc/jetty.xml to deploy Solr’s single webapp directly (remove server/contexts/solr-jetty-context.xml).
  • Adapt code/tests for Jetty 12.1 API/behavior changes (HTTP client transport API changes; proxy request/response framing; RuntimeIOException removal).

Reviewed changes

Copilot reviewed 93 out of 93 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
solr/webapp/gradle.lockfile Lock Jetty artifacts to 12.1.10; add new compression modules.
solr/ui/gradle.lockfile Update Kotlin/WASM dependency lock resolution (Ktor client JS vs CIO for WASM).
solr/ui/build.gradle.kts Scope Ktor CIO to desktop; add Ktor JS client for WASM.
solr/test-framework/gradle.lockfile Lock Jetty test dependencies to 12.1.10; add compression modules.
solr/solrj/gradle.lockfile Lock Jetty test dependencies to 12.1.10; add compression modules.
solr/solrj-zookeeper/gradle.lockfile Lock Jetty test dependencies to 12.1.10; add compression modules.
solr/solrj-streaming/gradle.lockfile Lock Jetty test dependencies to 12.1.10; add compression modules.
solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientCompatibilityTest.java Update Jetty HttpClient transport accessor API usage.
solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java Replace deprecated/removed BlockingArrayQueue constructor usage.
solr/solrj-jetty/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc Add upgrade note about Jetty deployer removal and config change.
solr/solr-ref-guide/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/server/gradle.lockfile Lock server Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact.
solr/server/etc/jetty.xml Deploy Solr webapp directly; add max response header size property; remove deployer block.
solr/server/contexts/solr-jetty-context.xml Remove obsolete context descriptor (no longer used without deployer).
solr/packaging/test/test_start_solr.bats Add packaging test to verify /solr context deployment.
solr/modules/sql/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/scripting/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/s3-repository/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact.
solr/modules/opentelemetry/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/ltr/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/language-models/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/langid/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/jwt-auth/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/gcs-repository/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/extraction/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/cuvs/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/cross-dc/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/clustering/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/modules/analysis-extras/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/cross-dc-manager/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules and renamed EE webapp artifact.
solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java Add regression tests for Jetty 12.1 proxy request/response framing behavior.
solr/core/src/java/org/apache/solr/servlet/HttpSolrProxy.java Adjust proxy header/body handling for Jetty 12.1 (Host/Content-Length).
solr/core/src/java/org/apache/solr/jersey/container/JettyBridgeResponseWriter.java Adjust Content-Length propagation behavior for Jetty/Jersey bridge.
solr/core/src/java/org/apache/solr/handler/CatStream.java Replace removed Jetty RuntimeIOException with JDK UncheckedIOException.
solr/core/src/java/org/apache/solr/core/SolrCore.java Replace removed Jetty RuntimeIOException with JDK UncheckedIOException.
solr/core/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/benchmark/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
solr/api/gradle.lockfile Lock Jetty dependencies to 12.1.10; add compression modules.
gradle/libs.versions.toml Bump Jetty version to 12.1.10; add Ktor JS client alias.
changelog/unreleased/SOLR-18297-update-jetty-12.1.10.yml Add changelog entry for the Jetty upgrade.
solr/licenses/jetty-xml-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-xml-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-util-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-util-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-start-12.1.10-shaded.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-start-12.0.34-shaded.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-session-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-session-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-server-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-server-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-security-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-security-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-rewrite-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-rewrite-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-jmx-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-jmx-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-io-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-io-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http2-server-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http2-server-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http2-hpack-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http2-hpack-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http2-common-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http2-common-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http2-client-transport-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http2-client-transport-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http2-client-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http2-client-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-http-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-http-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-ee10-webapp-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-ee10-webapp-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-ee10-servlets-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-ee10-servlets-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-ee10-servlet-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-ee10-servlet-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-ee-webapp-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-ee-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-deploy-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-deploy-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-compression-gzip-12.1.10.jar.sha1 Add SHA1 for new Jetty compression module jar.
solr/licenses/jetty-compression-common-12.1.10.jar.sha1 Add SHA1 for new Jetty compression module jar.
solr/licenses/jetty-client-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-client-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-alpn-server-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-alpn-server-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-alpn-java-server-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-alpn-java-server-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-alpn-java-client-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-alpn-java-client-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.
solr/licenses/jetty-alpn-client-12.1.10.jar.sha1 Add SHA1 for updated Jetty jar.
solr/licenses/jetty-alpn-client-12.0.34.jar.sha1 Remove SHA1 for old Jetty jar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java Outdated
Comment thread solr/core/src/test/org/apache/solr/servlet/HttpSolrProxyTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants